﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BrickAndBrick
{
    public class BBStep
    {
        public BBMap map;
        public int scanPos = -1;
        public int movePos;
        public int moveDirection;
        public int moveSteps;

        public BBStep(BBMap map)
        {
            this.map = map;
            scanPos = -1;
            movePos = 0;
        }
        public BBStep(BBMap map, int movePos, int moveDirection, int moveSteps)
        {
            this.map = map;
            this.scanPos = -1;
            this.movePos = movePos;
            this.moveDirection = moveDirection;
            this.moveSteps = moveSteps;
        }


        public override string ToString()
        {
            string str = string.Empty;
            switch (moveDirection)
            {
                case 0:
                    str = $"({movePos / BBMap.COL + 1},{movePos % BBMap.COL + 1})向左{moveSteps}格";
                    break;
                case 1:
                    str = $"({movePos / BBMap.COL + 1},{movePos % BBMap.COL + 1})向上{moveSteps}格";
                    break;
                case 2:
                    str = $"({movePos / BBMap.COL + 1},{movePos % BBMap.COL + 1})向右{moveSteps}格";
                    break;
                case 3:
                    str = $"({movePos / BBMap.COL + 1},{movePos % BBMap.COL + 1})向下{moveSteps}格";
                    break;
                default:
                    break;
            }
            return str;
        }
    }
}
